package permutationgame;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Solution {
	private static String nextPlayer(String player) {
		return player.equals("Alice") ? "Bob" : "Alice";
	}
	private static int decrivity(String perm) {
		int decrivity = 0;
		for(int i = 1; i < perm.length(); i++)
			if(perm.charAt(i) < perm.charAt(i - 1))
				decrivity++;
		return decrivity;
	}
	private static String winner(String perm, int decrivity, Map<String, Boolean> m, String player) {
		String nextPlayer = nextPlayer(player);
		Boolean win = m.get(perm);
		if(win != null) {
			if(win)
				return player;
			else
				return nextPlayer;
		}
		for(int i = 0; i < perm.length(); i++) {
			String newPerm = perm.substring(0, i) + perm.substring(i + 1);
			char c = perm.charAt(i);
			int newDecrivity = decrivity;
			if(i > 0 && c < perm.charAt(i - 1))
				newDecrivity--;
			if(i + 1 < perm.length() && perm.charAt(i + 1) < c)
				newDecrivity--;
			if(i + 1 < perm.length() && i > 0 && perm.charAt(i + 1) < perm.charAt(i - 1))
				newDecrivity++;
			if(newDecrivity <= 0) {
				m.put(perm, true);
				return player;
			}
			if(winner(newPerm, newDecrivity, m, nextPlayer).equals(player)) {
				m.put(perm, true);
				return player;
			}
		}
		m.put(perm, false);
		return nextPlayer;
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		try {
			int T = in.nextInt();
			for(int t = 0; t < T; t++) {
				int N = in.nextInt();
				String perm = "";
				for(int n = 0; n < N; n++)
					perm += (char)(in.nextInt() + 'A' - 1);
				System.out.println(winner(perm, decrivity(perm), new HashMap<String, Boolean>(), "Alice"));
			}
		} finally {
			in.close();
		}
	}
}
